var t = require;
var e = module;
var o = exports;
var n =
    (this && this.__extends) ||
    (function () {
        var t = function (e, o) {
            return (t =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (t, e) {
                        t.__proto__ = e;
                    }) ||
                function (t, e) {
                    for (var o in e) e.hasOwnProperty(o) && (t[o] = e[o]);
                })(e, o);
        };
        return function (e, o) {
            function n() {
                this.constructor = e;
            }
            t(e, o), (e.prototype = null === o ? Object.create(o) : ((n.prototype = o.prototype), new n()));
        };
    })();
Object.defineProperty(o, "__esModule", {value: !0});
var r = t("ConfS"),
    a = t("Platforms"),
    i = (function (t) {
        function e() {
            var e = (null !== t && t.apply(this, arguments)) || this;
            return (
                (e.openId = ""),
                (e.nickname = ""),
                (e.roleName = ""),
                (e.headImgURL = ""),
                (e.gender = 0),
                (e.A = ""),
                (e.selectedLanguageKey = ""),
                (e.musicOn = !0),
                (e.soundOn = !0),
                (e.shakeOn = !0),
                (e.fangchenmi_date = 0),
                (e.fangchenmi_startTime = 0),
                (e.testEffectsIndex = 0),
                (e.testSkinIndex = 0),
                (e.showBox = !1),
                (e.gongshiDebug = !1),
                (e.showDebugPanel = !1),
                (e.下次弹出每日钻石 = !0),
                (e.timeScale = 1),
                (e.最后登录日子 = 0),
                (e.clickedHutuiqiang = !1),
                (e.当天试玩过的游戏appId们 = []),
                (e.用户当天跳转过的CPA图标 = []),
                (e.已客服签到 = !1),
                (e.收藏 = "未提示收藏"),
                (e.已添到桌面 = !1),
                (e.已签到 = !1),
                (e.签到次数 = 0),
                (e.已点击每日金币 = !1),
                (e.meiriGemsTimes = 0),
                (e.已点击每日钻石 = !1),
                (e.meiriCoinsTimes = 0),
                (e.已自动弹出好友助力 = !1),
                (e.giftCodes = []),
                (e.lastGiftCode = ""),
                (e.首次进入游戏的路径 = ""),
                (e.首次进入游戏的场景值 = -2),
                (e.误触黑 = !1),
                (e.节日日子 = ""),
                (e.节日宝箱 = []),
                (e.已阅读节日文案 = !1),
                (e.已自动弹出弹窗活动 = !1),
                (e.已领取弹窗活动奖励 = !1),
                (e.七日红包已引导跳转 = !1),
                (e.七日红包开始领的时间 = 0),
                (e.上一个七日红包领取时间 = 0),
                (e.七日红包当天领取记录 = []),
                (e.系统每天随机指派好友送温暖Index = -1),
                (e.视频1分享0Index = -1),
                (e.charges = []),
                (e.玩家总次数 = {}),
                (e.玩家今日总次数 = {}),
                (e.score = -1),
                (e.被邀请openIds = []),
                (e.已经满足条件的被邀请openIds = []),
                (e.items = null),
                (e.lastRestoreWatchVideoSec = 0),
                (e.看视频CDSec = 0),
                e
            );
        }
        return (
            n(e, t),
            (e.prototype.fix = function () {
                this.fixItems(),
                    this.items || (this.items = {}),
                    "看视频" in this.items || (this.items["看视频"] = r.DatasManager.看视频上限),
                    "视频券" in this.items || (this.items["视频券"] = 0);
            }),
            (e.prototype.getItem = function (t) {
                return (this.items && this.items[t]) || 0;
            }),
            (e.prototype.setItem = function (t, e) {
                (this.items[t] = e), this.setDirty();
            }),
            (e.prototype.addItem = function (t, e) {
                this.setItem(t, this.getItem(t) + e);
            }),
            (e.prototype.reset = function () {
                var e = this.A,
                    o = this.openId,
                    n = this.nickname,
                    r = this.headImgURL,
                    a = this.gender,
                    i = this.selectedLanguageKey,
                    s = this.musicOn,
                    c = this.soundOn,
                    l = this.首次进入游戏的场景值,
                    u = this.误触黑,
                    p = this.score;
                t.prototype.reset.call(this),
                    (this.A = e),
                    (this.openId = o),
                    (this.nickname = n),
                    (this.headImgURL = r),
                    (this.gender = a),
                    (this.selectedLanguageKey = i),
                    (this.musicOn = s),
                    (this.soundOn = c),
                    (this.首次进入游戏的场景值 = l),
                    (this.误触黑 = u),
                    (this.score = p),
                    this.更新登录日子(),
                    this.fix();
            }),
            (e.prototype.getCurrDate = function () {
                return Math.floor((new Date().getTime() / 36e5 + 8) / 24);
            }),
            (e.prototype.更新登录日子 = function () {
                var t = this.getCurrDate();
                return this.最后登录日子 >= t
                    ? 0
                    : ((this.最后登录日子 = t),
                      console.log("最后登录日子=" + this.最后登录日子),
                      (this.当天试玩过的游戏appId们.length = 0),
                      (this.用户当天跳转过的CPA图标.length = 0),
                      (this.节日宝箱.length = 0),
                      (this.已客服签到 = !1),
                      (this.已签到 = !1),
                      (this.已点击每日金币 = !1),
                      (this.meiriGemsTimes = 0),
                      (this.已点击每日钻石 = !1),
                      (this.meiriCoinsTimes = 0),
                      (this.已自动弹出好友助力 = !1),
                      (this.已自动弹出弹窗活动 = !1),
                      (this.已领取弹窗活动奖励 = !1),
                      (this.上一个七日红包领取时间 = 0),
                      (this.七日红包当天领取记录.length = 0),
                      (this.系统每天随机指派好友送温暖Index = -1),
                      (this.视频1分享0Index = -1),
                      (this.玩家今日总次数 = {}),
                      (this.被邀请openIds.length = 0),
                      this.setDirty(),
                      t);
            }),
            (e.prototype.get昵称 = function () {
                switch (a.default.platformType) {
                    case "微信小游戏":
                    case "QQ小程序":
                    case "红包QQ":
                        if (this.nickname) return this.nickname;
                }
                return this.roleName;
            }),
            (e.prototype.加玩家总次数 = function (t, e) {
                for (void 0 === e && (e = 1); e--; )
                    this.玩家总次数[t] > 0 ? this.玩家总次数[t]++ : (this.玩家总次数[t] = 1),
                        this.玩家今日总次数[t] > 0 ? this.玩家今日总次数[t]++ : (this.玩家今日总次数[t] = 1),
                        this.on加玩家总次数 && this.on加玩家总次数(t);
            }),
            (e.prototype.获取玩家总次数 = function (t) {
                return this.玩家总次数[t] > 0 ? this.玩家总次数[t] : 0;
            }),
            (e.prototype.获取玩家今日总次数 = function (t) {
                return this.玩家今日总次数[t] > 0 ? this.玩家今日总次数[t] : 0;
            }),
            e
        );
    })(t("Storage_").default);
o.default = i;
